<template>
  <view class="my-settle-box">
    <label class="radio" @click="changeAllState">
      <radio color="#FF4536" :checked="isFullCheck" /><text>全选</text>
    </label>
    <view class="amount-box">
      <view class="amount">
        合计:<text>￥{{checkedGoodsAmount}}</text>
      </view> 
    </view>
    <view class="btn-settle">
      结算({{checkedCount}})
    </view>
  </view>
</template>

<script>
  import {mapGetters,mapMutations} from 'vuex'
  export default {
    name:"my-settle",
    data() {
      return {
        
      };
    },
    computed:{
      ...mapGetters('m_cart',['checkedCount','total','checkedGoodsAmount']),
    
      isFullCheck(){
      return this.total===this.checkedCount
      }
    },
    methods:{
      ...mapMutations('m_cart',['updateAl1GoodsState']),
      changeAllState(){
        this.updateAl1GoodsState(!this.isFullCheck)
      }
      
    }
  }
</script>

<style lang="scss">
.my-settle-box{
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 50px;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 0 0 0 20rpx;
  box-sizing: border-box;
  .radio{}
  .amount-box{
    .amount{
      color: #FF4536;
      font-weight: 700;
    }
  }
  .btn-settle{
    width: 150rpx;
    min-width: 150rpx;
    height: 100%;
    background: #FF4536;
    color: #fff;
    text-align: center;
    line-height: 50px;
  }
}
</style>
